<?php
include "../inc-config.php";
print "<link rel='stylesheet' href='../templates/default/boardstyle.css' type='text/css'>";
$username = $_GET['username'];
$password = $_GET['password'];
$keynode = $_GET['keynode'];
$username = strip_tags($username);
$password = strip_tags($password);
$keynode = strip_tags($keynode);
$getuserkeys = "SELECT * FROM b_users WHERE username='$username' AND password='$password' AND keynode='$keynode'";
$getuserkeys2 = mysql_query($getuserkeys, $forum) or die("Error #1: " . mysql_error());
$getuserkeys3 = mysql_fetch_array($getuserkeys2);
if(strlen($getuserkeys3['username']) < 3)
{
  print "<table class='maintable'>";
  print "<tr class='headline'><td><center>Registering...</center></td></tr>";
  print "<tr class='forumrow'><td><center>";
  print "No such user.";
  print "</td></tr></table>";
}
else if(strlen($getuserkeys3['email']) < 4)
{
  print "<table class='maintable'>";
  print "<tr class='headline'><td><center>Registering...</center></td></tr>";
  print "<tr class='forumrow'><td><center>";
  print "Invalid user.";
  print "</td></tr></table>";
}
else
{
  print "<table class='maintable'>";
  print "<tr class='headline'><td><center>Registering...</center></td></tr>";
  print "<tr class='forumrow'><td><center>";
  $update = "Update b_users set validated='1' where username='$username'";
  mysql_query($update, $forum) or die("Error #2: " . mysql_error());
  print "Account activated";
  print "</center></td></tr></table>";
}
?>